package com.ghck.shop.dao.provider;

import java.util.Map;

import com.ghck.shop.model.Seller;

public class SellerMapperProvider {

	
	public String listSellers(Map<String, Object> params){
		StringBuffer sb = new StringBuffer();
		sb.append("select * from t_seller where 1=1");
		Seller seller = (Seller) params.get("seller");
		if(seller.getStatus() != null){
			sb.append(" and status=#{seller.status}");
		}
		sb.append("  order by last_modify_time desc limit #{start},#{limit}");
		return sb.toString();
	}
	
	public String countListSellers(Map<String, Object> params){
		StringBuffer sb = new StringBuffer();
		sb.append("select count(*) from t_seller where 1=1");
		Seller seller = (Seller) params.get("seller");
		if(seller.getStatus() != null){
			sb.append(" and status=#{seller.status}");
		}
		return sb.toString();
	}
}
